package com.yanwq.sayhi.repository;

import com.yanwq.sayhi.bean.Article;
import com.yanwq.sayhi.bean.Comment;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 作者：yanweiqiang。
 * 日期：2016/2/24。
 */
@Repository
public interface CommentRepo extends CrudRepository<Comment, Long> {

    Page<Comment> findByArticleOrderByPublishTimeDesc(Article article, Pageable pageable);

    int countByArticle(Article article);
}